#include "omron_text.h"

OmronText::OmronText(QString ParentName, QString MyName, QWidget *parent)
    : OmronWidget(ParentName, MyName, parent )

 {

 }

bool OmronText::eventFilter(QObject *obj, QEvent *e)
{
    if( e->type() == QEvent::KeyPress )
    {
        QKeyEvent *keyEvent = static_cast< QKeyEvent * >(e);
        switch( keyEvent->key() )
        {
            case '\t': keyEvent->ignore();

            case Qt::Key_Down: emit nextFieldSig(); break;
            case Qt::Key_Up:   emit prevFieldSig(); break;
//            case Qt::Key_Right: IncVal(); break;
//            case Qt::Key_Left: DecVal(); break;
//            case Qt::Key_F1: emit nextField(700); break;
//            case Qt::Key_F2: emit nextField(701); break;
//            case Qt::Key_F3: emit nextField(702); break;
//            case Qt::Key_F4: emit nextField(703); break;
//            case Qt::Key_F5: emit nextField(704); break;
//            case Qt::Key_F6: emit nextField(705); break;

            default:
                keyEvent->accept();
        }
        //emit error_sig (ErrCodePack(ERR_AUTO_MAN_VAL, ));
        return true;
    }
    return QObject::eventFilter(obj, e);
}

